﻿@{
    ViewData["Title"] = "Home Page";
    Layout = null;
}




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html data-use-rem="750">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="format-detection" content="telephone=no, email=no">
    <title>湖南天雁</title>
    <link rel="stylesheet" href="css/reset-h5.css">
    <link rel="stylesheet" href="css/index.css">
    <link rel="stylesheet" href="css/swiper.css">
    <style>
        .swiper-container img {
            height: 2.72rem;
        }
    </style>
</head>

<body>
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <img src="img/banner.jpg" width="100%" class="swiper-slide" />
            <img src="img/banner1.jpg" width="100%" class="swiper-slide" />
        </div>
        <div class="swiper-pagination"></div>
    </div>
    <div class="bigbox">
        <div class="input-box">
            <div class="tit">扫码查询</div>
            <div class="saoma" id="scan"></div>
        </div>
        <div class="input-box">
            <div class="tit">输码查询</div>
            <input placeholder="" class="search-input" /><span class="search-btn">查询</span>
        </div>
    </div>
    <div class="fwResult" id="fwresult" style="display: none;"></div>
    <div class="ts-box1">
        <h1>温馨提示:</h1>
        <p>每个防伪码只能正确查询1次，首次查询请消费者注意看清楚查询结果。</p>
    </div>

    <div class="ts-box2">
        <h1>查询方法:</h1>
        <p>1、扫码关注湖南天雁官方微信公众号。</p>
        <p>
            2、关注后，点击产品防伪中的防伪查询，扫码或手输20位数码，即可查询真伪信息。
        </p>
        <p>3、查询结果与实物信息对比，判别真伪。</p>
        <p>4、原旧版防伪标查询，请刮开涂层，手动输入20位防伪码，只可查询真伪信息（无产品信息）。旧版防伪标签认证时间截止至2019年12月31日。</p>
    </div>

    <script src="js/rem.js"></script>
    <script src="js/jquery.min.js"></script>
    <script src="js/swiper.min.js"></script>
    <script type="text/javascript" src="http://m10.zx3315.cn/getip.ashx" charset="gb2312"></script>
    <script src="http://m10.zx3315.cn/getip.ashx"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
			var swiper = new Swiper('.swiper-container', {
				pagination: '.swiper-pagination',
				paginationClickable: true,
				spaceBetween: 0,
				centeredSlides: true,
				autoplay: 3000,
				autoplayDisableOnInteraction: false
			});

			wx.config({
				debug: false,
				appId: 'wx76db50393ff444cb',
				timestamp: '1599991368',
				nonceStr: '5d53018446334694',
				signature: '96241b44fca107be1571b24a2263a38ef5cb3af6',
				jsApiList: [
					"scanQRCode"
				]
			});

			var btn = document.getElementById('scan');
			wx.ready(function() {
				// 在这里调用 API
				btn.onclick = function() {
					wx.scanQRCode({
						needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
						scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码
						success: function(res) {
							var result = res.resultStr;
							if(result.indexOf("?") >= 0) {
								result = result.split("?")[1];
							};
							if(result.indexOf("=") >= 0) {
								result = result.split("=")[1];
							};
							query(result);
						}
					});
				}
			});

			$('.search-btn').click(function() {
				var code = $('.search-input').val();
				if(code == "") {
					alert('请输入防伪码');
					return;
				}

				query(code);
			});

			function query(result) {
				//	alert(result);
				//				if((result == undefined) || (result == "")) {
				//					result = $("#code").val();
				//				}

				jQuery.ajax({
					type: "get",
					url: "http://wlms.zx3315.cn/query/",
					dataType: "jsonp",
					jsonp: "callback",
					data: "message=" + result + "&userinfo=" + ip + "&callback=?",
					success: function(msg) {
						$('.fwResult').show();
						$('.ts-box1').hide();
						$('.ts-box2').hide();
						$('#fwresult').html("<br>"+msg.value1+"</br>");
					}
				});

				jQuery.ajax({
					type: "get",
					url:"http://wl.tyen.com.cn:93/interface/query.aspx",
					dataType: "jsonp",
					jsonp: "callback",
					data: "querycode=" + result + "&QueryIP=" + ip + "&callback=?",
					success: function(msg) {

						if(msg.ProductCode !=""){
						$('#fwresult').append("<br>产品编码："+msg.ProductCode +"</br>");
						$('#fwresult').append("<br>经销商："+msg.DealerName +"</br>");
						$('#fwresult').append("<br>物流码："+msg.Qutsidedata +"</br>");
						$('#fwresult').append("<br>出库时间："+msg.AddTime +"</br>");
					 }
					}
				});
			}
    </script>
</body>

</html>
